<div data-role="header">
    <a href="#myPanel" class="ui-btn ui-icon-grid ui-btn-icon-left">菜单</a>
    <h1><?=$res['title']?></h1>
    <a href="javascript:history.back(-1);" class="ui-btn ui-icon-back ui-btn-icon-left">返回</a>
</div>


<div data-role="main" class="ui-content">
    <?=$article['content']?>
</div>
<div data-role="footer" data-position="fixed">
    <h1>价格：<span style="font-size:18px;color:red"><?=$res['price']?></span> 元   | <a href="javascript:;" onclick="create_order()">>>>点击购买</a></h1>
</div>
<script type="text/javascript">
    $(function(){
        $('#fot').attr('style','display: none;');
    })

    function create_order(){
        layer.open({
            content: '购买“<?=$res['title']?>”，费用“<?=$res['price']?>”元，是否确定？',
            style:'width:600px',
            btn: ['确认', '取消'],
            shadeClose: false,
            yes: function(){
                layer.open({content: '请稍候...',time: 1});
                $.post("<?=site_url('order/create')?>",{pid:<?=$res['id']?>},function(data){

                    if(data > 0){
                        location.href="<?=site_url('order/update')?>?oid="+data;
                    }else{
                        layer.open({
                            content: data,
                            style:'width:100%',
                            btn: ['确定']
                        });
                    }
                });
            },
            no: function(){
                layer.open({content: '取消购买', time: 1});
            }
        });
    }
</script>